// import { $C, $rp } from '@/utils/constants';

// const noteP = $C.notifications.position;

export default (note) => {
  const errs = ['评论提醒参数错误'];
  if (note.groupInfo.err) errs.push(note.groupInfo.msg);
  if (note.noteInfo.err) errs.push(note.noteInfo.msg);

  if (errs.length > 1) return { id: note.id, err: true, msg: errs.join(', ') };

  return {
    type: note.type,
    author: note.authorInfo,
    desc: '有一份新公告',
    group: {
      title: note.groupInfo.title,
      path: `/groups/${note.groupInfo.id}`,
    },
    annc: {
      title: note.noteInfo.title,
      path: `/groups/${note.groupInfo.id}/announcements/${note.noteInfo.id}`,
    },

    id: note.id,
    read: note.read,
    created_at: note.created_at,
    updated_at: note.updated_at,
  };
};
